package com.ojoin.trade.common_core.web.dao.impl;

import java.util.HashMap;
import java.util.List;

import org.springframework.stereotype.Repository;

import com.ojoin.trade.common.exception.BusinessException;
import com.ojoin.trade.common.exception.DaoException;
import com.ojoin.trade.common.web.dao.impl.BaseDaoImpl;
import com.ojoin.trade.common_core.web.dao.TbBranchDao;
import com.ojoin.trade.common_core.web.domain.TbBranch;

@Repository
public class TbBranchDaoImpl extends BaseDaoImpl<TbBranch> implements TbBranchDao {

	@Override
	public List<TbBranch> queryBankBranch(String area_id, String bankname)
			throws BusinessException {
		String mapMethodName = "queryBankBranch";
		try {
			HashMap<String, Object> paramMap = new HashMap<String, Object>();
			paramMap.put("area_id", area_id);
			paramMap.put("bankname", bankname);
			
			return this.sqlSessionTemplate.selectList(getSqlName(mapMethodName), paramMap);
		} catch (Exception e) {
			throw new DaoException(String.format("查询银行分支机构号信息出错！语句：%s",
					getSqlName(mapMethodName)), e);
		}
	}
	

}
